import numpy as np


def read_csv(path='output-2021-11-29.csv'):
    data = np.loadtxt(path, dtype=str, delimiter=',', encoding='utf-8', skiprows=1)
    return data


# 生成 code name 对照表
def generate_info():
    data = read_csv('output-2021-11-29.csv')
    # print(data)
    dict1 = {}
    for row in data:
        dict1[row[0]] = row[1]
    return dict1


def generate_info_reverse(file_name='output-2021-11-29.csv'):
    data = read_csv(file_name)
    # print(data)
    dict1 = {}
    for row in data:
        dict1[row[1]] = row[0]
    return dict1
